//package com.shop.admin.config;
//
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//import org.springframework.messaging.simp.config.MessageBrokerRegistry;
//import org.springframework.web.socket.config.annotation.EnableWebSocketMessageBroker;
//import org.springframework.web.socket.config.annotation.StompEndpointRegistry;
//import org.springframework.web.socket.config.annotation.WebSocketMessageBrokerConfigurer;
//import org.springframework.web.socket.server.standard.ServerEndpointExporter;
//
//@Configuration
//@EnableWebSocketMessageBroker
////@ConditionalOnProperty(name = "spring.profiles.active", havingValue = "dev")
//public class WebSocketConfig implements WebSocketMessageBrokerConfigurer {
//    @Bean
//    public ServerEndpointExporter serverEndpointExporter(){
//        return new ServerEndpointExporter();
//    }
//
////    @Override
////    public void registerStompEndpoints(StompEndpointRegistry registry) {
////        registry.addEndpoint("/websocket");
////    }
////
////    @Override
////    public void configureMessageBroker(MessageBrokerRegistry registry) {
////        //表示客户端订阅地址的前缀信息，也就是客户端接收服务端消息的地址的前缀信息
////        registry.enableSimpleBroker("/topic");
////        //指服务端接收地址的前缀，意思就是说客户端给服务端发消息的地址的前缀
////        registry.setApplicationDestinationPrefixes("/app");
////    }
//    @Override
//    public void registerStompEndpoints(StompEndpointRegistry registry) {
//    registry.addEndpoint("/websocket").setAllowedOrigins("*").withSockJS();
//}
//    @Override
//    public void configureMessageBroker(MessageBrokerRegistry registry) {
//        registry.enableSimpleBroker("/queue","/topic","/user");
//        registry.setUserDestinationPrefix("/user");
//    }
//}
